<template>
	<view>
		<view class="1">
			<u-search :show-action="true" actionText="搜索" :animation="true"></u-search>
		</view>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure ==1 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="入职申请"></uni-title>
			<text>申请员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==2 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="转正申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==3 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="调动申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==4 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="离职申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==5 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="招聘申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==6 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="补卡申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==7 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="请假申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==8 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="加班申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==9 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="出差申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==10 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="报销申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==11 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="付款申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==12 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="合同申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<uni-card v-for="(e,index) in cclist" :key="index" v-show="e.enclosure==13 & e.spid==3" v-if="emplevels==2"
			@click="mine(e.id)">
			<uni-title type="h3" title="备用金申请"></uni-title>
			<text>入职员工:{{e.ename}}</text>
			<br>
			<text>入职部门:{{e.department}}</text>
			<br>
			<view class="">
				提交人:{{e.name}}
			</view>
			<view class="">
				提交时间:{{aa(e.createtime)}}
			</view>
			<view class="">
				审批状态:<span style="color: #18BC37;"> 审批通过</span>
			</view>
		</uni-card>
		<view class="" style="text-align: center;color: #00007f; margin-top: 20rpx;">
			暂时没有更多数据了┗|｀O′|┛ 嗷~~~
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: {},
				eid: '',
				cclist: {},
			}
		},
		onLoad(res) {
			this.users();
			this.eid = res.eid
			this.emplevels = this.user.emplevels
			this.selectcc()
		},
		methods: {
			aa(date) {
				const dateTime = new Date(date)
				const YY = dateTime.getFullYear()
				const MM =
					dateTime.getMonth() + 1 < 10 ? '0' + (dateTime.getMonth() + 1) : dateTime.getMonth() + 1
				const DD =
					dateTime.getDate() < 10 ? '0' + dateTime.getDate() : dateTime.getDate()
				const hh =
					dateTime.getHours() < 10 ? '0' + dateTime.getHours() : dateTime.getHours()
				const mm =
					dateTime.getMinutes() < 10 ? '0' + dateTime.getMinutes() : dateTime.getMinutes()
				const ss =
					dateTime.getSeconds() < 10 ? '0' + dateTime.getSeconds() : dateTime.getSeconds()
				return `${YY}-${MM}-${DD}`
			},
			users() {
				this.user = uni.getStorageSync('user')
				console.log(this.user)
			},
			selectcc() {
				uni.request({
					url: 'http://localhost:9525/aduit/approve/selectcc?eid=' + this.eid,
					method: 'POST',
					success: (res) => {
						this.cclist = res.data.data.list
						console.log(res.data.data.list)
					},
				});
			},
			mine(id) {
				uni.navigateTo({
					url: './ccago?id=' + id
				})
			},
		}
	}
</script>

<style>

</style>
